package com.google.android.gms.common;

import android.app.PendingIntent;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import androidx.annotation.Nullable;
import com.google.android.gms.common.annotation.KeepForSdk;
import com.google.android.gms.common.internal.ShowFirstParty;
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable.Class;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable.Constructor;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable.Field;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable.Param;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable.VersionField;
import com.huawei.hms.adapter.internal.CommonCode.MapKey;
import com.huawei.hms.framework.network.grs.GrsBaseInfo$CountryCodeSource;
import com.huawei.hms.framework.network.restclient.hianalytics.HianalyticsData;
import o.aoz;
import o.apc;
import o.apw;

@Class(creator = "ConnectionResultCreator")
public final class ConnectionResult extends AbstractSafeParcelable {
    public static final Creator<ConnectionResult> CREATOR = new apw();
    @ShowFirstParty
    @KeepForSdk
    public static final ConnectionResult ˎ = new ConnectionResult(0);
    @Field(getter = "getResolution", id = 3)
    private final PendingIntent ˊ;
    @Field(getter = "getErrorMessage", id = 4)
    private final String ˋ;
    @VersionField(id = 1)
    private final int ˏ;
    @Field(getter = "getErrorCode", id = 2)
    private final int ॱ;

    @Constructor
    public ConnectionResult(@Param(id = 1) int i, @Param(id = 2) int i2, @Param(id = 3) PendingIntent pendingIntent, @Param(id = 4) String str) {
        this.ˏ = i;
        this.ॱ = i2;
        this.ˊ = pendingIntent;
        this.ˋ = str;
    }

    public ConnectionResult(int i) {
        this(i, null, null);
    }

    public ConnectionResult(int i, @Nullable PendingIntent pendingIntent) {
        this(i, pendingIntent, null);
    }

    public ConnectionResult(int i, @Nullable PendingIntent pendingIntent, String str) {
        this(1, i, pendingIntent, str);
    }

    public final int ˊ() {
        return this.ॱ;
    }

    @Nullable
    public final PendingIntent ˋ() {
        return this.ˊ;
    }

    @Nullable
    public final String ˎ() {
        return this.ˋ;
    }

    static String ˊ(int i) {
        switch (i) {
            case -1:
                return GrsBaseInfo$CountryCodeSource.UNKNOWN;
            case 0:
                return "SUCCESS";
            case 1:
                return "SERVICE_MISSING";
            case 2:
                return "SERVICE_VERSION_UPDATE_REQUIRED";
            case 3:
                return "SERVICE_DISABLED";
            case 4:
                return "SIGN_IN_REQUIRED";
            case 5:
                return "INVALID_ACCOUNT";
            case 6:
                return "RESOLUTION_REQUIRED";
            case 7:
                return "NETWORK_ERROR";
            case 8:
                return "INTERNAL_ERROR";
            case 9:
                return "SERVICE_INVALID";
            case 10:
                return "DEVELOPER_ERROR";
            case 11:
                return "LICENSE_CHECK_FAILED";
            case 13:
                return "CANCELED";
            case 14:
                return "TIMEOUT";
            case 15:
                return "INTERRUPTED";
            case 16:
                return "API_UNAVAILABLE";
            case 17:
                return "SIGN_IN_FAILED";
            case 18:
                return "SERVICE_UPDATING";
            case 19:
                return "SERVICE_MISSING_PERMISSION";
            case 20:
                return "RESTRICTED_PROFILE";
            case 21:
                return "API_VERSION_UPDATE_REQUIRED";
            case 99:
                return "UNFINISHED";
            case 1500:
                return "DRIVE_EXTERNAL_STORAGE_REQUIRED";
            default:
                return "UNKNOWN_ERROR_CODE(" + i + ")";
        }
    }

    public final boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof ConnectionResult)) {
            return false;
        }
        ConnectionResult connectionResult = (ConnectionResult) obj;
        if (this.ॱ == connectionResult.ॱ && aoz.ॱ(this.ˊ, connectionResult.ˊ) && aoz.ॱ(this.ˋ, connectionResult.ˋ)) {
            return true;
        }
        return false;
    }

    public final int hashCode() {
        return aoz.ॱ(Integer.valueOf(this.ॱ), this.ˊ, this.ˋ);
    }

    public final String toString() {
        return aoz.ˋ(this).ॱ("statusCode", ˊ(this.ॱ)).ॱ(MapKey.HAS_RESOLUTION, this.ˊ).ॱ(HianalyticsData.EXCEPTION_MESSAGE, this.ˋ).toString();
    }

    public final void writeToParcel(Parcel parcel, int i) {
        int ॱ = apc.ॱ(parcel);
        apc.ॱ(parcel, 1, this.ˏ);
        apc.ॱ(parcel, 2, ˊ());
        apc.ˎ(parcel, 3, ˋ(), i, false);
        apc.ˎ(parcel, 4, ˎ(), false);
        apc.ˎ(parcel, ॱ);
    }
}
